﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;

namespace HotelManagementClient.Model
{
    public class ChatMessage : INotifyPropertyChanged
    {
        private string msgType;
        public string MsgType
        {
            get { return msgType; }
            set
            {
                if (msgType != value)
                {
                    msgType = value;
                    Notify();
                }
            }
        }

        private string message;
        public string Message
        {
            get { return message; }
            set
            {
                if (message != value)
                {
                    message = value;
                    Notify();
                }
            }
        }
        
        private string nickName;
        public string NickName
        {
            get { return nickName; }
            set
            {
                if (nickName != value)
                {
                    nickName = value;
                    Notify();
                }
            }
        }
        
        private string createTime;
        public string CreateTime
        {
            get { return createTime; }
            set
            {
                if (createTime != value)
                {
                    createTime = value;
                    Notify();
                }
            }
        }
        
        private string avatar;
        public string Avatar
        {
            get { return avatar; }
            set
            {
                if (avatar != value)
                {
                    avatar = value;
                    Notify();
                }
            }
        }

        protected void Notify([CallerMemberName] string obj ="")
        {
            if(PropertyChanged != null)
            {
                this.PropertyChanged(this, new PropertyChangedEventArgs(obj));
            }
        }

        private TypeLocalMessageLocation messageLocation;
        public TypeLocalMessageLocation MessageLocation
        {
            get { return messageLocation; }
            set
            {
                if(messageLocation != value)
                {
                    messageLocation = value;
                    Notify();
                }
            }
        }

       

        public event PropertyChangedEventHandler? PropertyChanged;
    }
}
